package com.joe.learn.web;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class MainController {

    @Value("${user.name}")
    private String name;

    @Value("${user.nickName}")
    private String nickName;

    @Value("${user.age}")
    private Integer age;

    @RequestMapping("/me")
    @ResponseBody
    public String queryName() {
        System.out.println("name=" + name);
        System.out.println("nickName=" + nickName);
        System.out.println("age=" + age);
        return name + ": " + nickName + ": " + age;
    }


}
